class Store<K,V> {

    private map:any = new Map();

    // 往仓库里面追加数据
    add(index:K,value:V):void {
        this.map.add(index,value);
    }

    // 根据索引拿出数据
    get(index:K):V {
        return this.map.get(index);
    }

}

class People {

    name:string;

    age:number;

    constructor(name:string,age:number) {
        this.name = name;
        this.age = age;
    }

}

let s1:Store<string,People> = new Store();
s1.add("1",new People("罗佰君",20));
s1.add("2",new People("伍雨薇",20));

let p:People = s1.get("1");
console.log(p);